package Tree;
class TreeNode {
    int val;        // 节点值（用于 System.out.print(node.val)）
    TreeNode left;  // 左子节点
    TreeNode right; // 右子节点

    // 可选：构造方法
    TreeNode(int val) {
        this.val = val;
    }

    TreeNode(TreeNode left,int val, TreeNode right) {
        this.val = val;
        this.left = left;
        this.right = right;
    }

    @Override
    public String toString() {
        return  val +" "+
                 left +" "+
                 right +" "
                ;
    }
}